/**
 * Copyright &copy; 2012-2016 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.yuhanginfo.modules.sys.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.persistence.Page;
import com.yuhanginfo.common.service.CrudService;
import com.yuhanginfo.modules.sys.entity.Parts;
import com.yuhanginfo.modules.sys.dao.PartsDao;

/**
 * 物料管理Service
 * @author yangs
 * @version 2017-09-28
 */
@Service
@Transactional(readOnly = true)
public class PartsService extends CrudService<PartsDao, Parts> {
    @Autowired
    private PartsDao partsDao;

	
	@Transactional(readOnly = false)
	public void save(Parts parts) {
		super.save(parts);
	}
	
	@Transactional(readOnly = false)
	public void delete(Parts parts) {
		super.delete(parts);
	}



	public Parts selectByCode(String code) {
		
		return partsDao.selectByCode(code);
	}
	
	public Parts getNameByCode(String code) {
		
		return partsDao.getNameByCode(code);
	}

	public Page<Parts> partMainList(Page<Parts> page, Parts parts) {
		parts.setPage(page);
		page.setList(partsDao.partMainList(parts));
		return page;
	}

	public Parts selectByPartsCode(String code) {
		
		return partsDao.selectByPartsCode(code);
	}

	public List<Parts> setByCode(String codes) {
		
		return partsDao.setByCode(codes);
	}
	
}